<template>
  <el-dialog
    title="详情"
    :visible.sync="dialogVisible"
    :before-close="close"
    width="40%"
  >
    <el-descriptions :column="2" border size="medium">
      <el-descriptions-item label="名称">{{ form.name }}</el-descriptions-item>
      <el-descriptions-item label="学习时间">{{ form.studyTime }}</el-descriptions-item>
      <el-descriptions-item label="学习地点">{{ form.studyAddress }}</el-descriptions-item>
      <el-descriptions-item label="提交时间">{{ form.submitTime }}</el-descriptions-item>
      <el-descriptions-item label="提交人">{{ form.submitUser }}</el-descriptions-item>
      <el-descriptions-item label="所在组织">{{ form.organization }}</el-descriptions-item>
    </el-descriptions>
    <div class="titleStyle">
      <span>学习记录（学习资料、学习感悟）</span>
    </div>
    <div>
      <v-md-preview :text="form.content" height="100%" mode="preview" left-toolbar="" right-toolbar="" />
    </div>
    <span v-if="!isDetail" slot="footer" class="dialog-footer">
      <el-button @click="close">关闭</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  data () {
    return {
      dialogVisible: false,
      form: {}
    }
  },
  methods: {
    open (row) {
      this.form = { ...row }
      this.dialogVisible = true
    },
    close () {
      this.form = {}
      this.dialogVisible = false
    }
  }
}
</script>
<style lang="scss" scoped>
  .titleStyle {
    font-weight: 600;
    height: 35px;
    line-height: 35px;
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 8px;
    background-color: #d8eff9;
    display: flex;
    justify-content: space-between;
  }
  .upload-demo {
    display: inline-block !important;
    margin-left: 16px;
  }
</style>
